#!/bin/sh /etc/rc.common

START=93
USE_PROCD=1
 
get_config() {
	config_get path $1 path ""
}

start_service() { 
	config_load routergo
	config_foreach get_config routergo
	procd_open_instance
	procd_set_param command /usr/sbin/routergo server --unix /var/run/routergo/local.sock
	if [ -n "$path" ]; then
		procd_append_param command --path "$path" 
	fi
	procd_set_param stderr 1
	procd_set_param respawn
	procd_close_instance
}
